package com.test;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Writable;
public class Commodity implements Writable {
    private int    prod_id;
    private int    cust_id;
    private String   data;
    private int    channel_id;
    private int    promo_id;
    private int    quantity_sold;
    private float  amount_sold;

    public void readFields(DataInput input)throws IOException{
        this.prod_id = input.readInt();
        this.cust_id = input.readInt();
        this.data = input.readUTF();
        this.channel_id = input.readInt();
        this.promo_id = input.readInt();
        this.quantity_sold = input.readInt();
        this.amount_sold = input.readFloat();
    }
    public void write(DataOutput output)throws IOException{
        output.writeInt(this.prod_id);
        output.writeInt(this.cust_id);
        output.writeUTF(this.data);
        output.writeInt(this.channel_id);
        output.writeInt(this.promo_id);
        output.writeInt(this.quantity_sold);
        output.writeFloat(this.amount_sold);
    }

    public int getProd_id() {
        return prod_id;
    }

    public void setProd_id(int prod_id) {
        this.prod_id = prod_id;
    }

    public int getCust_id() {
        return cust_id;
    }

    public void setCust_id(int cust_id) {
        this.cust_id = cust_id;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public int getChannel_id() {
        return channel_id;
    }

    public void setChannel_id(int channel_id) {
        this.channel_id = channel_id;
    }

    public int getPromo_id() {
        return promo_id;
    }

    public void setPromo_id(int promo_id) {
        this.promo_id = promo_id;
    }

    public int getQuantity_sold() {
        return quantity_sold;
    }

    public void setQuantity_sold(int quantity_sold) {
        this.quantity_sold = quantity_sold;
    }

    public Float getAmount_sold() {
        return amount_sold;
    }

    public void setAmount_sold(Float amount_sold) {
        this.amount_sold = amount_sold;
    }
}
